﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WPFWebControl
{
    public partial class MainWindow : System.Windows.Window, INotifyPropertyChanged
    {
        private void gotoNextItem()
        {
            if (ListLinks.Count > m_nCount)
            {
                lstLinkBuck.SelectedIndex = m_nCount;
                tblLinkBuck item = ListLinks.ElementAt(m_nCount);
                processAt(item);

                m_nCount++;
            }
        }


        private void processAt(tblLinkBuck item)
        {
            try
            {
                activeItem = item;
                tbLog.Text += " \r\n +" + item.RealLink;
                tbLog.Text += " \r\n";
                m_bCLik = false;
                m_bNew = true;
                m_bEnter = false;
                mainProcess = StepProcess.GOTO_LINK;
                MyWebBrowser.Source = new Uri(item.LinkBuck);

            }
            catch (Exception ex)
            {
                activeItem = null;
                System.Windows.MessageBox.Show(ex.Message);
            }
        }
        
    }
}
